Fixes a possible crash of the server