updated to work with permalinks

updated to work with permalinks