fixed on device ready function