some big changes on login and index