Finally got enter button to work properly