Add onInstalled and onRestarted events