modify ruby funtion