better finish logic for Xunit