fixing bug where query string causes hash to be wrong due to incorrect path detection