adding in rails and integrating with prev changes