fixed onlyFor scope issue and minor associatedMedia issue