Perfomance bug fix