added file type check for uploaded documents