Added check for tasks depending on themselves