fixed login and sort