Created more functions to encompass form events