Fixing pid file issue