Replaced conditional command on notify_email to use only sendmail
Changed variable name
Missed one variable
Lock correctly