syntax errors on lower ruby version fixed