prevent double frame and prevent enter and reload page event