Fixed correct database usage