fixed generate_print

Signed-off-by: John Liu <johnnnpl@gmail.com>