Finally fixed the ordering problem