fix for rails x < 4.1