improve ui handling