fixed a bug in the r::scheme method