Rails 4 compatibility fix