Medium effects of the photo-addition of naphthalene and pyrrole