guarantee correct file rename on download