adding support for rebuilding