Changed for making it Thread Safe