Add sorting
Weird exception with logger