script for waiting the emulator to load