Updated with emulator support