Added support for pid files