fix bug and make output more clear