some simple error handling.