fix modal bug - displays after closing