Refresh page when popup is open

Refresh page when popup is open

When a popup is open, JQM adds hash to the url #&ui-state=dialog. If the user will refresh the page when have the popup open, and then again open the popup and refresh, it might led to many hashes in the url.
Is there's any way of canceling the hash behaviour? 
I use the hash myself, and it's not good for me if I do
if (window.location.hash)
{
// I meant to my own set hash, not the one JQM sets
}