add functions to harden func