replaced != with !== to compare with null