Environmental effects on second order perturbation energy