fixed issues with getLastOrder