Fixed the order of references