fixed logout functioanlity