Fix bug in user email retrieval