fixed js bug if to = length