Adding error handling for demo user role detection