Changed loc of when to remove pid lock file