Endnote X6 Incorrect numbering of references in my paper- how do I get the correct order?

When I change the references from Author-date to numerical formating, the references do not appear in the order that they are in the paper eg. first reference is labelled (4).  How to I correct this so that the references are numbered by the order that they appear in the text?