try take() instead of pull()
move Client error checking to beginning