Fixing bug where the histroical data will not be pulled correctly
Making the changes for the latest code