fixed error with undefined client