fixing median