Attempting to extend pathname but failing