Fixed to remove tmp file