fix bug in permalinks