logout issue, few bugs