Added check to make sure that dependent task exist.