statements being committed for both button and submit