works when submit button is pressed

and focus is still on the last element