adding exception handling for permalink