fixed cask function