Fixed the 'extend' method