performance optimalization, bugfix