fixes location order