bugfix of issues #1, #3