Fixed the bug that the url is too long while writting the database