variable change bug corrected