upgrades for 1.9 and rails 4