RSync feature added, Locks added and thread issues fixed