Fix db undifined