fixed enter key loop bug