add onLoad option

closes #5