Modification of the method of boundary functions for singularly perturbed partial differential equations