It would be a good solution to synchronize the messagesPerPage setting with the number of messages displayed in the app.