Fix for rails 3