Search for orders and fixed some bugs