fix on device ready function