trying to make it work on rails 4