update docs; fix a bug