added a before_spawn hook and an example
make this a package