Fix for rails 3.xx