move around finalize function to public, now it can be called from hybridLambda build