This should be in a place which ran only once. If it is maintained like this the code is ran for every leaflet map instance created.