Improve pathname to return an array

Was earlier returning a string