add logging
correct decimal precision and scale