checks if url segment is presetn before capitalizing