bugfix and enhancements