updated to rails 4 and fixed a bunch of issues