Influence of gain on transmission of nanocavity containing metamaterials