fixed issue with median #4