Javascript: getting same script object back on push