Three dimensional convective instability in nematic liquid crystal under an ac field