Enhanced the error check logics for input data.