fix bug when hook_deviceready returning false.