added close product function