Fixing bug where the histroical data will not be pulled correctly