So, when I run the function first time it works amazing and without any problems, but when I run it second time, the website just freezes and I can\'t do anything.