added logging and scheduling