fixes... and delete temp file