Added error messages and task scheduling.