Add return before all calbacks.
Remove error from empty tasks in getAvailableTasks
Attach event listeners before firing events.