set nlpir and rewrote some function so we can start without command line parameter and text file ,but from database dynamic