code issue with boolean variables fixed