fix master filename detection