fix for script with rails4