fix bug on monthly aggregate and rank