important fix in logic