bugfix and add doc