tweak logging, error handling

should should weird thing when data is out of range