Modifications for rails 4