input validation and change to .on from .click for items