Fixed a bug when submiting a task using Enter key