Fix submit event handler

Sorry to dive in and change something like this -- it won't happen again, just wanted to help out with the bug that I introduced.