added code to add/remove 'active' class on refresh