ruby code fixes