Fixed mail and added stderr func to generalFunc.lua