Bonding a wafer on the substrate