Add DB function on collection load instead.
Assumption from previous commit was all wrong. It basically just segfaulted the process instead of actually working. This one totally works though.