fixed cocoon bug