fix #408: fixes check if user is delegate
Merge pull request #410 from janno42/delegate_bug

fix #408: fixes check if user is delegate