Fix onRestarted behavior