fix site crash on refresh