cleaned function to accept enter but not tab