fixed some bugs, up to 1000 rails no lag. tested