bug fix for cancelling running process