add function print and finish, fix read_string bug