Bugfix for rails 4