fixed a bug where data was being duplicated