bugfix and test added