updated enter key logic to match the fcurrent process