Created try/catch handler for exception