Uses realpath() to check for valid path