fixed bug: email flag was not working properly
merge in commits from Master branch