Fix rails security issues