Minor fix on logic