bugfix and add manual test