Add more error control