couple of possilbe js error fixes