add fix for all same sequence case of median algorithm