changed method of conversion for db