Modification to make it work with emulator