better invalid double detection