Fix call to function with missing parameters
Add missing part of the top sent query with the date_limit variable