bug fixes for order repository