Fixing a bug on the dialog modal