fixing browser refresh issue