fix js error on non-portfolio pages