upgraded login process and access handling of the states
update