fixing ResourceLoader and adding JS to modal