amend exception handling