updated the chemfilter and make it thread safe
Signed-off-by:Syed Asad Rahman <s9asad@gmail.com>