Added lock, fixed rsync