fixed server crashes - DONT COMMIT CODE THAT DOESNT RUN