fix bugs with abort and resume