updated for emulator