include bgtask func for error mail