removed some bugs inorder to handle multi threading