Changed PDF alert to before send email, fixed server log