Fixes #6294 Correct check email,

Correct position of check email and avoid double query.