fixed issues with a variable never being used.