create signup function with validation