Form get stuck on waiting after submit button is pressed