Fix Rails exception