fixed the condition to make active