take deleted users into account

Bugger. Didn't deal with the "deleted user" issue. Fixed now.