Corrected wrong handling of submit buttons