bug fix for rails 3