bugs fixed for new js