updated to work with newer gems