Thread wont sort or deliver messages