fix string optimization problem