handle exception clicking log out, also change to an element check