handle RCode in right way

https://gist.github.com/eye-scuzzy/6547632