fixed bug: email flag was not working properly