Modifies behaviour to be compliant when hosted in a rails 4 app