Fixed a problem in the password authentication and added database selection for the queue.