Fixed error removing temporary file