Variable must be volatile as it's used in multiple threads