Added code for removing capsules from learning paths