solved bugs on edit.js