Use safe close for server modal