a possible fix for form re-submission and empty values submission