Added failsafe to rebuild.