add sanity_check function, fix rsyncing