using the if statements in the route
deleting the if from the view