Fix timing issue in UI test

see #265