update and rebuild