version v2 handled corner cases