handle RCode in right way