added changes to attempt to terminate program when everyone gets file