adjusted javascript to edit a package
fixed creating package bug