Adapted for case of user with multiple names
Altered logout functionality to fix user delete bug