Added more onXXX handlers for apps