fixed build optimisation issues