more error handling, also protect _private functions