fix for Cannot reassign variable name error