fix pidfile location and start function