mode hooks