validation -- handle invalid code received