commented some of the error checks