Added functional validate function for signup form