Using device ready event