Enhancing foam stability in porous media by applying nanoparticles