fix warning test cond always true by removing unnecessary test