reverted to check null instead of empty