pidfile handling added.