server and logic edited