Login and logout controller fixed