better handling of logout then logbackin