add rebuild method