speed up the way to fetch logs
added a function to send mail after building