different fixes to update to rails 4