refactored connect and disconnect functions
only update changes from server. do not overwrite everything because this is too slow on a phone