removing temp files and correcting return address from the read procedure