Error handling

I implemented a handler for the error and its worked.