trying fix for variables not being set in different stages