performance fixing

@azakhary