move wait_for_emulator to run before script