add support for pidfile