Update Controller.java

excessive if statement