fixed performance problem
fixed some scope problems