Fix rails 4 compability