fix order of anchor and query string in permalink

fixes #155