inf loop in resolvePackageSync

fixes #27