fixed some bugsm wrote cli client kind of to test, things seem to work