testing debug
fixed bad error check