karma command bugfix and unit test