fix for null value

typeof null equals to 'object' so need to add one more check for it