fix compilation error and output