fix issues #11, #12