refine and bugfix
refine and bugfix