fixed S bug