added NaN check in number check