Minor bug fix on AddOrder function