fixed server crash on refresh