added deviceready to resolve code2 error