using an ugly dialog but it works.