fix modal weird behaviour