Fixed list command so it uses SQL instead of Haskell