Fix showDialog method