implementing login switch