added functionalities to the form macro