Added pid file creation