Fixed thread safety problem, default endpoint problem