user input check added