fix bug in sync.sh where directory would be created twice