bug fix for odering