fix bug with pids checking