a little error handling and some work on providers