fix upgrade to rails 3 errors