manage galley js error