fixed using other function than median