Set database on earned credit before saving.