Fixed orderind from database