Added login functionality and login count.