fixed cleanup for server script