Synchronized methods accessing the listeners to avoid race conditions