fix validation when hitting the enter key