user login finally working as expected