fix index out of range when only one line exists
current_pos -> current_row
add category dict
cleaning