begin login functionality