fixes to support rails 4