fix for rails 3