Fixed condition bug