bug fixed for js