Add onload code hook