fixed bugs about query and hash detection on url