copied over build hook from examples