used POST method and extract function to get form data