Fixing bug in editor
Improve performance