more error handling and such