Created a var to pass into func as suggested by @loonies