various bugs, add example