add ability to return errors