make it work in rails 4