fixed work_median filter