fix mac osx modal bug