if/else method added in Server.java