Rebuilb shell and export shell_buffer to stringbuffer