Fixed database selection error