improvements for pid file