another attempt at fixing js error