Fixed bug and updated doc