added space to regex
added valid name check
added production error handling