add latest build logic