Fixed email subject, and cache file and added logging