Fixed a potential server crash