added new if statement to line 49 of app.rb