as per stackoverflow suggestion, working fine in emulator