added pid file to ensure creation/removal of pids