this seems like a hack. is this the part for which you didn't find a nice workaround for?

in any case please remove the console.log