added file check to avoid file error when options.extra is not present