Fixed the isNumber() function logic