added functionality to don't duplicate purchases