Fixed database issue