fixing js for template