convert empty strings to None
added args
moved away from split name
fixed error handling