updating to be compatible with rails 4