Fixed error in extend.js