fixed a bug in the chain loop, remove mod stuff