fixed for rails 4