bug fixes with js stuff