bugfix and workaround