Use the deviceready event for initialization
Update example