UPD: del double and fix condition