- improve pid file handling