Move functions.js register to child