added checking for isNaN