added exception handling for callback