fixing locale middleware