added the ability to create pid file