Should just create the pathname object and assign it rather that construct it twice