fixes null email references
Fixes logic