Well. What you're doing is if the side == 1 (the top face) you return the texture.
But if it isn't 1, you then call that function again passing the same side value, causing an infinite recursion loop (if side isn't top, repeat).
If you look at the regular grass, you'll see that it returns a top face, a side face, or it references BlockDirt for the last (bottom) face.