added auto creation of pids dir