categories.js remake unload and on error function