Fixed memory leak + added support for enter key pressed on prompts