Added Fix for page reload issue. Previous code working only in Firefox/Ubuntu