trying to fix js error