you've to add a synchronized block because there's a possibility to call this method from different threads at the same time