renderJS: add check to prevent gadgets from multiple insertions or not being loaded