rb 2.99 compatibility, not much tested