fixed logout behaviour
using sets instead of lists to avoid duplicates