fixing issue with connection being undefined at broker construction
updating tests