writing pid to file