wrong handling of pid files