added Refreshing page and some code tweaks