small error control added