added file type check when adding files. TODO check that file exists