corrected a namespace reference and added a file valid check for the mapping handler