push pkg = {} outside of loop