fixing close issue error ui handling