Fixing bug where packages were being added multiple times