fixed some modal bugs