Bugfix + performace improvement