do not pass invalid input to calculator, preventing numberformatexception
check type