Fix bug that timed server out, added dynamic tree making