Fix Task afterhook