This is not the full path, it just ends up as master.tpl. You have to pass the path to if you check for a file.

Run it and echo the output of file_exists. It will return false all the time.