Fixing critical bug which prevented ->extend() from working
fixing missing error handling