how do i set up a shadow pass using nodes

i am trying to setup a shadow pass in cycles with nodes i already have a shadow plane and i used nodes to composite it with real footage but the shadow plane is sort of visible in the final render here is a screenshot is there any way to get rid of the black edges