refresh pages properly