Added counter to avoid adding scripts multiple times