fixed bugs with orders