wrapping alert in deviceready event