Add extra check in median_oracle.py