Changed code to save raw data in table