Fixed the addTask function.