Added new exception catching.