server logic fixes