Fixed pidfile issue