attempt at fixing js error