prevent multiple form submission; moved code to functions.php