changes to prevent currentOrder is null error