Added checks to make sure data is not duplicated