added login functionality