adding wait4emulator