add javascript asserts for some issues