Added rcode check