Fixed problem when form was not valid