Substrate effect on doping and degradation of graphene