Updated to work with 2.1 ruby