Correcting null pointer caused by triggerAuthorEmail