An effective modification of He’s variational approach to a nonlinear oscillator