adding hook for setting variable