Fixed database update issue