added isEmulator support