add error handling on exception