fix core dump and display mistake for top level items