added conditions to improve appearance of email version