Update to work with rails4