fixd js error on pattern editor