merge login functionality