Added logic to rename the file on successfull download