making showDialog method