sorted login with persistance