adding logout funcyionality