changed logic of changing packs and did some refactoring - IT WORKS