Fi x a bugs with state's settings parent. addFile function defined now.