Updated database lib and made queue injectable