fix a bug when the email directory not exists