added flash types, but error message not working for rails 4