corrected an unnecessary usage of the volatile keyword