fixes for older version of rails