Fixing modal popup issues