fixed bug and doc improved