login + logout functionality finally working