Fixing modal behaviour