check for bad input