screen logic added to server code