fix a bug when newItem after a detail row