Add package.json and fix bug