Adding submit function to form class