Took care of the invalid exception when aborting