Fix bugs on create.js and edit.js