added client for debugging

found and fixed a bug in the process