Nowadays, with the increase in the amount of information generated in the webspace, many web service providers try to use recommender systems to personalize their services and make accessing the content convenient. Recommender systems that only try to increase the accuracy (i.e., the similarity of items to users' interest) will face the long tail problem. It means that popular items called short heads appear in the recommendation lists more than others since they have many ratings. However, unpopular items called long-tail items are used less than popular ones as they reduce accuracy. Other studies that solve the long-tail problem consider users' interests constant while their preferences change over time. We suggest that users' dynamic preferences should be taken into account to prevent the loss of accuracy when we use long-tail items in recommendation lists. This study shows that the two reasons lie in the following: 1) Users rate for different proportions of popular and unpopular items over time. 2) Users of all ages have various interests in popular and unpopular items. As a result, recommendation lists can be created over time with a different portion of long-tail and short-head items. Besides, we predict the age of users based on item ratings to use more long-tail items. The results show that by considering these two reasons, the accuracy of recommendation lists reaches 91%. At the same time, the long tail problem is better improved than other related research and provides better diversity in recommendation lists in the long run.