Add logout and sorting