fixed for rails 3