Bug fix for modal