Fixed database timeout issues