Added some changes for the retrieving orders