Unexpected exception fixed