fixed wrong conditional