Fix regression in beforebuild functions

They can be synchronous