Moved database requests out of loops for performance increase
Moved database requests out of loops for performance increase

Jonneitapuro/isoskaba2,Jonneitapuro/isoskaba2,Jonneitapuro/isoskaba2,Jonneitapuro/isoskaba2