fixed wrong condition