adding file cleanup back
setting the correct content length