added email checking and a status thread