Added function for submitting forms