added pidfile support