add color support and fix some bugs