wrapping up login functionality