fix modal bugs