add tabs and fix bug