added input validation

yet to do : clearing input