lays eggs singly, burying them in moist soil.[116] The smoky jungle frog (Leptodactylus pentadactylus) makes a nest of foam in a hollow. The eggs hatch when the nest is flooded, or the tadpoles may complete their development in the foam if flooding does not occur.[117] The red-eyed treefrog (Agalychnis callidryas) deposits its eggs on a leaf above a pool and when they hatch, the larvae fall into the water below.[118] The larvae developing in the eggs can detect vibrations caused by nearby predatory wasps or snakes, and will hatch early to avoid being eaten.[119] In general, the length of the egg stage depends on the species and the environmental conditions. Aquatic eggs normally hatch within one week when the capsule splits as a result of enzymes released by the developing larvae.[120]