finish Program P, but error when printing