added login and admin functions