gave functionality to sumbit and cancel buttons