fixed bug on Null check