fixing up JS issues