volatile variable placed on another method