re-implemted broker, fixed broker unit test