fixed the condition