fix error handling, return nil error upon success