fixes js dialog shown problem