add finished hook/callback to lib