fix wrong output and output formatting