Fix incorrect ruby code