DBHelper fix

changed the for-loops for arrays to a foreach-loop