fix activate function