fix: check task exist before calling callback