Add delegate method $app.onload.
this must call $app.loaded after it finish its works.