update custom.js to general extension validate fn