altered login functionality so that login does not occur on page reload