Agent now checks for a valid filey