bugfix and update test