Modified the functionality of the getPath method (renamed to getFileName).