Fix bug in weekly query