added max allowed peers check and fixed listing bug