clean up, input check