fix minimal build logic