changed parameter function to void cast