Add some exception handling for error return