DEBUG handle exceptions properly