Added the creation of a pid file