modified some function