fix editor and emulator bug