cocoon bug fix