Fixed opening of a new media. There was a deadlock when trying to change resource.