changed it so it can work on the server