made the pid file stuff work better