Add volatile to ensure on multhread