Changing pid check logic