bug fixs and doc added