fixed database functions in classes