cleared deadlock by moving wait below cloding the pipes
delete philip's temp files