put correct pid in file