fixing ordering problem