Fix pagination and add login form