you probably want to add a return in here. Upon error, you can't be sure ws != nil (Even if in this case it is)