Improved submit method.