fixes potential comparison flaw