bugfix & improvements