fixing some issues relating to rails 4