Fixes tab key bug, validating before pressing key