When the first http request was made by browser, it calls a couple of times the function. All the features are working as designed, but the request should happen only once.