fix products collapse function