Added SYNCHRONIZED() method to make sure its syncd with main thread.