fixing recuresive and synch