bugfix and codestyle