fixes a bug occurring with aggregated js