Fixed last_displayed query