fix a bug in level-editor